from django.db import models


class CateGroup(models.Model):
    name = models.CharField(max_length=20)


class Cate(models.Model):
    name = models.CharField(max_length=20)
    parent = models.ForeignKey("self",on_delete=models.SET_NULL,null=True,blank=True,related_name="sub_cate")
    group = models.ForeignKey(CateGroup,on_delete=models.SET_NULL,null=True)
    level = models.IntegerField(default=1)





